package com.fr.data.core.db;

import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLReadable;
import com.fr.base.xml.XMLableReader;
import java.io.Serializable;

public class TableProcedure
  implements XMLReadable, Serializable, Cloneable
{
  public static final String TABLE = "TABLE";
  public static final String VIEW = "VIEW";
  public static final String PROCEDURE = "PROCEDURE";
  public static final String ALLTABLE = "ALLTABLE";
  private String schema;
  private String name = "";
  private String type = "TABLE";

  public TableProcedure()
  {
  }

  public TableProcedure(String paramString1, String paramString2, String paramString3)
  {
    this.schema = paramString1;
    this.name = paramString2;
    this.type = paramString3;
  }

  public String getName()
  {
    return this.name;
  }

  public String getSchema()
  {
    return this.schema;
  }

  public String getType()
  {
    return this.type;
  }

  public void setSchema(String paramString)
  {
    this.schema = paramString;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public void setType(String paramString)
  {
    this.type = paramString;
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof TableProcedure))
      return false;
    TableProcedure localTableProcedure = (TableProcedure)paramObject;
    return ((ComparatorUtils.equals(localTableProcedure.getName(), getName())) && (ComparatorUtils.equals(localTableProcedure.getSchema(), getSchema())) && (ComparatorUtils.equals(localTableProcedure.getType(), getType())));
  }

  public String toString()
  {
    return ((this.schema != null) ? this.schema + "." : "") + getName();
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isAttr())
    {
      String str;
      if ((str = paramXMLableReader.getAttr("schema")) != null)
        setSchema(str);
      if ((str = paramXMLableReader.getAttr("name")) != null)
        setName(str);
      if ((str = paramXMLableReader.getAttr("type")) != null)
        setType(str);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("TableProcedure").attr("type", getType()).attr("name", getName());
    if (getSchema() != null)
      paramXMLPrintWriter.attr("schema", getSchema());
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}